$(function(){
    $("#upload-btn").on("click",function(){
        var username=$("#username").val();
        var password=$("#password").val();
        if(username==""||password==""){
            $.alert("请填写用户名或密码！");
        }else{
            var o = new AjaxOptions('#data_form');
            o.put('service_code', 'P90001');
            o.sus = function(data){
                var result = data.result;
                if(result=="0"){
                    $.alert("绑定失败，请检查用户或密码是否正确!");
                }else if(result=="1"){
                    $.toast("绑定成功");
                    window.setTimeout(function(){
                       location.href=BaseUrl+'wx/_page/index.do';
                    },2000);
                }
            };
            $.ajax(o);
        }
    });
});